#ifndef MQUEUE_COMMUNICATE_H
#define MQUEUE_COMMUNICATE_H

#include <mqueue.h>

// #define QUEUE_NAME "/my_queue"
#define MAX_MSG_SIZE 1280   //消息大小
#define MAX_MSG_NUM 10      //最大信息条数

#define MQUEUE_R_PATH "/mqueue_R_data"
#define MQUEUE_L_PATH "/mqueue_L_data"

mqd_t global_R_mq;//队列
mqd_t global_L_mq;

struct mq_attr global_R_attr;
struct mq_attr global_L_attr;

int mqueue_init(char *mp_path,char r_l);

int mqueue_send(char r_l,char *data,int size);//发送
char* mqueue_receive(char r_l);//接收

int mqueue_cloes(char r_l);
int mqueue_delete(char r_l);

#endif